HomeОбразованиеRelated VideosMore From: The Bad Tutorials

SQL Tutorial - 9: Create Table Statement

1222 ratings | 309735 views
In this tutorial we'll learn to create tables in SQL using the CREATE TABLE Statement.
Html code for embedding videos on your blog
Text Comments (68)
Dibya Sharma (23 days ago)
nice teacher..this video helped me .............This is my sql tutorial channel Please watch and subscribe my channel also give me suggestion in comment that i upload new video for You all. Thank u. https://www.youtube.com/watch?v=q9mk6Wsc2Sc
Naseer bangash (27 days ago)
what is the command for gender?
Sathish Zeo (1 month ago)
good teaching tq u
Lalit sharma (1 month ago)
Many times u #sound like #virat kohli.... ..bro..!!
Avaneet Chowdhary (3 months ago)
accha h bt language me thodi problem h so ...thaku for that
ATIKUR RAHMAN (3 months ago)
Sir ... What is this application software
Rogelio Cruz (3 months ago)
Thanks a lot man, you made it very simple!
Geeta Yadav (4 months ago)
Ratahe kya kya bol rage ho
Rohit Bhardwaj (4 months ago)
where are u doing this on which database
Manju Bajaj (5 months ago)
suppose i want to create a table name ABC using DDL queries... in this table we have a column named as month.. i want that values of month should integer between 1 and 12 only? can u plz help me how to write a DDL query for this in MS-Access?
ALESSANDRA PUCCIO (5 months ago)
thank you
westfield90 (5 months ago)
How do you specify Auto Increment and also collate charset etc?
shamim ahsan (6 months ago)
Is it case sensitive language?
The Perfect Tutorials (7 months ago)
ronoy188 (9 months ago)
what software
Aahira Khan (9 months ago)
which software is it?
ANIRBAN (10 months ago)
I wrote datatypes in uppercase then compilation told that table not formed ,but in lowercase it formed ,Why?you told that they are not case sensitive
Nour Kenitra (1 year ago)
Still unclear We need a clear practice
HIRAK MONDAL (1 year ago)
The concept of primary key must be taught first then all these...
Thank you so much for sharing it.
Amit Kumar Gaur (1 year ago)
Thanks for video bt I also want Oracle and java core,advance full video pls help me sir
Aayan Media (8 months ago)
malik fayiz (1 year ago)
Thank you for posting the video, I appreciate it.
Amol Mundada (1 year ago)
plz tell me why ID field can not hold NULL values...in video at time 7:00
Moepi Maile (1 year ago)
Sir Can you check if my answer to this question is right pls Write a single SQL statement to create a new table named Login with five columns: Username(Text), Password(Text) LastUpdate(Date) Status(Text) and CustomerID(Interger) Assign Username as the primary key of the table The Password should never be NULL Set the default value of LastUpdate to the current date and time (Aust Time) Define a check on Status to make sure the value could either be active or inactive Assign CustomerID as a foreign key referencing the Customer table ANSWER CREATE TABLE Login (Username TEXT PRIMARY KEY NOT NULL, Password TEXT NOT NULL, Last Update DATETIME DEFAULT GETDATE (NZTIME), Status TEXT CHECK (Status = "active" OR Status = "inactive"), FOREIGN KEY (CustomerID) REFERENCE Customer (CustomerID) ON DELETE NO ACTION ON UPDATE NO ACTION )
Subrat Mohapatra (1 year ago)
though the output is executing correctly, there are red cross symbols against the steps written in the workbench.Can u pls clarify on the same ?
Muhammad Usama (1 year ago)
hi, Sir what command we used for MS SQL for describe a table.?
Fransuwel Mesquita (1 year ago)
The Bad Tutorials (1 year ago)
+Fransuwel Mesquita Thanks!
Bilal B (1 year ago)
which software i should download on my PC for SQL like we use dev for C++
use tmd gcc compiler
Yergalem Andetsion (2 years ago)
Funny Toaster (2 years ago)
not sure if i'm putting it wrong or i'm just plain stupid 3 create table cats 4 ( 5 id int primary key, 6 name varchar(30), 7 dob datetime, 8 email varchar(40), 9 ); yet still getting the Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 7
Ananya Srikanth (2 years ago)
Funny Toaster (2 years ago)
solved already btw but thanks for telling knowing that someone noticed it
Ananya Srikanth (2 years ago)
remove the comma after email varchar(40).
Noluthando Leeto (2 years ago)
thanks for sharing i neede this
Aayan Media (8 months ago)
MrAdschahal (2 years ago)
CREATE TABLE Employee ( id int primary key, name varchar(40), DOB datetime, email varchar (50), ); Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 6 how can i remove this error please help
S G (1 year ago)
MrAdschahal there should be no last comma after email varchar(40)
Funny Toaster (2 years ago)
still not working
WeSquare (2 years ago)
remove space between varchar AND (50)
A el-aina (2 years ago)
how do you clear the action output in MySql ?
Jubril Wilson (2 years ago)
Thank you for sharing!!
Rehan Ilahi (2 years ago)
bro how do we create a table in c sharp windows form
the end18 (2 years ago)
fuck you. stop talking and go to the point. fucking nerd.
Carla X (2 years ago)
Marlene Favelo if you don't like it, go find yourself another tutorial, stupid bitch
Aditya Rawat (2 years ago)
fuck you !! He is damn good.
Gyan (2 years ago)
nice bro...
Arindam Joarder (2 years ago)
Motherfucker talks so much
sun shine (9 months ago)
He's explaining you idiot.
Sahil Agarwal (2 years ago)
name is also a keyword in mysql,isnt it? because it has turned out to be blue immediately when it was typed. can we use keywords for the name of the field??
silentblad (2 years ago)
Great video & Thanks for the tutorials from Canada!
Jyotsana Mogha (3 years ago)
You are such a genius, a good teacher, loved all your SQL videos. Thank you
Oscar Healy (3 years ago)
I am glad i came across this
Thusitha Maduranga (3 years ago)
Nimish Pawar (3 years ago)
thankyou soo mch :)
Jigga Mane (3 years ago)
Thank you now I understand how to CREATE TABLE using SQL
Linkon (3 years ago)
if i want to add boolean datatype and want to set it's default value to false,  how can i do that?
praveen kumar (3 years ago)
superb tutorial
Aayan Media (8 months ago)
Mez Coppa (3 years ago)
These are great videos. At first, I wasn't sure how they'd be, but they've been great. I wanted to do something else whilst learning Java.
Aayan Media (8 months ago)
Swaraj (3 years ago)
We can have primary key on more than one column..not sure if it's your dbms limitation?
Oscar Healy (3 years ago)
+Swaraj he meant you can only have one primary key in any given table
syedsoyab soyab (4 years ago)
BoYcLuE (5 years ago)
This was fantastic. Exactly what I needed for my studies, thank you.

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.