question archive How do I write the code in sql to create a table that has the following: Create BusinessEntityID column as an integer
Subject:Computer SciencePrice:1.87 Bought8
How do I write the code in sql to create a table that has the following:
Answer:
We can create the table using below script:
CREATE TABLE BirthDay( BusinessEntityID INT NOT NULL, DoB DATE, CONSTRAINT pk_BD PRIMARY KEY(BusinessEntityID) );
Inserting the given record:
INSERT INTO BirthDay(BusinessEntityID, DoB) VALUES(1, '1990-01-01');
Querying table to show record:
SELECT * FROM BirthDay;
Create the table using CREATE TABLE command.
Created table named BirthDay, you may change it if needed.
To insert the record, use INSERT INTO statement as written above.
To query the table, write SELECT statement as written above.