Back to Browse

SQL Tutorial For Beginners | DDL Statements in SQL | SQL Full Course

70 views
Jan 28, 2023
18:10

SQL Tutorial For Beginners | DDL Statements in SQL | SQL Full Course Previous Chapters Chapter 5 Constraints in SQL : https://youtu.be/nv6Ow0emAJ0 Chapter 4 Datatypes in SQL : https://youtu.be/PedrfjN-PCo Chapter 3 Command Types in SQL : https://youtu.be/VZtRsZ4klhc Chapter 2 Oracle Live Free :- https://youtu.be/g257vfnM2mo Chapter 1 MySQL Download & Installation :- https://youtu.be/ErtPrysapLc welcome to TEK Solutions we are moving ahead with the next session of SQL for beginners if you haven't watched our previous videos and if you want to start from the basics you can watch our previous videos first and then come to this video and I'm providing you the link in the description below so let's start what is expected from this tutorial so in this video we will see ddl statements and what cover is it is we'll we'll cover a few basic statements like creating the table altering the table drop and truncate we will do the Hands-On practice as well and for that I already covered that how to install MySQL on your laptop that's free if you haven't watched that video again you can find the link in the description below or if you don't want to install anything on your laptop you can do the practice on Oracle live as well for that I already covered one session how to create the Oracle Live account it's also free and it's only for practicing and training so let's move on ddl commands so we will create and alter the tables this is basically required for creating and altering the part of your tables using the ddl commands number one it is create statement create statement will help us to create the table and the syntax of it is create table these are the two keywords create table table name whichever table name you want to give to your table that's a stable name make sure it's Unique and there is no other same name object exist in your schema create table table name bracket column which is a First Column of your table its data type and constraints constraint is something optional if you want you can provide otherwise comma then column 2 data type its constraint so on up to column n and its constraint close the bracket and that's it this is the syntax of create table and data types are the data types of the column we already covered what is data types in our previous session please check that video as well and constraints consent on a table you want to provide so and these are optional and if you don't know what is constraints you can check our previous video so let's move on let's create these two tables create table department and create table empty PT and EMP so let me open my my Sequel and we'll do the quick practice so let's create few tables TPT and EMP so this is the syntax we already discussed but let's see what are all the columns and data types and the constraints I have defined on it so DPT no is the column name integer is its data type and not null is the constraint on it D name loc and see finally I am declaring DPT number as a primary key similarly EMP create table EMP employee number integer for not null is the constraint and you can see all these are e-name job manager higher date salary these are the different columns with the different data types dptno integer and not null let's run this and the next one is this let's move ahead before we go ahead let me just insert some records into these two tables so that we can practice on it so you don't need to worry how we are inserting the data and all for now I'm going to copy this scripts into the description below you can easily just simply copy it and run it on your schema and we are going to cover how to insert the data and what are the syntax and everything in our upcoming sessions so for now let's insert the data into the DPT so one row I insert it there and I'm going to insert the next row once it is done just commit y commit and use we are using that we will definitely cover in the upcoming videos so for now let's select star from DPT and select star from EMP ath the tables let's let's see one by one so DPT has 10 cells New York are inserted similarly One recording to the EMP table as well so that's it congratulations we created two tables now CHAPTERS 0:00 | Introduction 00:35 | DDL Statements SQL 01:53 | Create Statement 06:12 | Cloning Existing Table 08:18 | Create Table From Select 10:01 | Alter Table Statement 14:18 | Drop Statement 15:41 | Truncate Statement SQL Tutorial For Beginners | DDL Statements in SQL | SQL Full Course

Download

0 formats

No download links available.

SQL Tutorial For Beginners | DDL Statements in SQL | SQL Full Course | NatokHD