How to create a table in the database?
To create a table, you need to apply the SQL statement CREATE TABLE with following syntax.
Syntax
CREATE TABLE (columnname datatype(size), columnname datatype(size)…);
Example
USE demodb;
CREATE TABLE Book(BookNumber
INT, Title VARCHAR(100), Author VARCHAR(100), Price FLOAT);
CREATE TABLE Student(RollNumber
INT, Name VARCHAR(100), Email VARCHAR(50), Mobile CHAR(10), Fees INT);
CREATE TABLE
IssueBooks(BookNumber INT, RollNumber INT, IssueDate DATE);
Comments
Post a Comment