create database players
use players
create table student
(
StudentID INT PRIMARY KEY, -- Primary key
FirstName NVARCHAR(50) NOT NULL, -- First name of the student
LastName NVARCHAR(50) NOT NULL, -- Last name of the student
DateOfBirth DATE, -- Date of birth
Gender CHAR(1), -- Gender (M/F)
EnrollmentDate DATE, -- Date of enrollment
Email NVARCHAR(100), -- Email address
PhoneNumber NVARCHAR(15), -- Phone number
Address NVARCHAR(255) -- Address
);
INSERT INTO student (StudentID, FirstName, LastName, DateOfBirth, Gender,
EnrollmentDate, Email, PhoneNumber, Address)
VALUES
(1, 'John', 'Doe', '2000-01-15', 'M', '2018-09-01', '
[email protected]', '123-
456-7890', '123 Main St, Anytown, USA'),
(2, 'Jane', 'Smith', '1999-05-23', 'F', '2017-09-01', '
[email protected]',
'234-567-8901', '456 Oak St, Othertown, USA'),
(3, 'Alice', 'Johnson', '2001-02-10', 'F', '2019-09-01',
'
[email protected]', '345-678-9012', '789 Pine St, Sometown, USA'),
(4, 'Bob', 'Brown', '2000-07-19', 'M', '2018-09-01', '
[email protected]',
'456-789-0123', '101 Maple St, Anycity, USA');
UPDATE student
SET FirstName = 'Ali'
WHERE StudentID = 2;
-- Verify the update
SELECT * FROM student WHERE StudentID = 2;
ALTER TABLE student
DROP COLUMN PhoneNumber;
DROP TABLE student;
select * from student