Creating a table
In this exercise, you will create a new table Person. For this task, you have to
- define the table by using
CREATE TABLE - define the necessary fields of the desired table
An example for creating a table Employee is shown below:
CREATE TABLE Employee (
ID INT,
Name CHAR(32)
);
Your task is to create a new table, Person, with the fields IndividualID,Firstname,Lastname, Address, and City.
Este ejercicio forma parte del curso
Hierarchical and Recursive Queries in SQL Server
Instrucciones del ejercicio
- Define the table
Person. - Define a field
IndividualID. - Set
FirstnameandLastnamenot to beNULLand of typeVARCHAR(255). - Define
BirthdayasDATE.
Ejercicio interactivo práctico
Prueba este ejercicio y completa el código de muestra.
-- Define the table Person
CREATE TABLE ___ (
-- Define the Individual ID
___ INT NOT NULL,
-- Set Firstname and Lastname not to be NULL of type VARCHAR(255)
Firstname VARCHAR(___) NOT NULL,
Lastname ___(___) ___ ___,
Address VARCHAR(255) NOT NULL,
City CHAR(32) NOT NULL,
-- Define Birthday as DATE
Birthday ___
);
SELECT *
FROM Person;