Due Date: 10/18/24
This program creates a database to store information about individuals.
CREATE DATABASE InTro;
This creates the database with the name InTro
.
USE InTro;
This command switches the context to the InTro
database for data manipulation.
CREATE TABLE pinfo (
id INT PRIMARY KEY AUTO_INCREMENT,
First_Name VARCHAR(20),
Last_Name VARCHAR(20),
Address_ VARCHAR(20),
City VARCHAR(20),
State_ VARCHAR(2),
Zip_code VARCHAR(5)
);
This creates a table named pinfo
with specified fields.
DESCRIBE pinfo;
This command displays the structure of the pinfo
table.
INSERT INTO pinfo (First_Name, Last_Name, Address_, City, State_, Zip_code)
VALUES
("Stephen","Angelella","2788 Marion Street","Bellmore","NY","11710"),
("Allen","Attaway","PO Box 643","Piscataway","NJ","08855"),
("Baron","Ballester","186 Lexington Avenue","Westwood","NJ","07675"),
("George","Bartels","77 Allen Road","Rockville Centre","NY","11570"),
("Michael","Bartolome","228 South 17th Avenue","Manville","NJ","08835"),
("Hugh","Bentley","7 Holly Tree Lane","East Islip","NY","11730"),
("Robert","Bielsky","931 Peninsula Blvd","Woodmere","NY","11598"),
("George","Botsch","511 Rockaway Street","West Islip","NY","11795"),
("Duane","Burrell","22 Van Buskirk Rd","Teaneck","NJ","07666"),
("Michael","Caldarella","108 Kemah-Mecca Lake Road","Newton","NJ","07860");
This command inserts multiple values into the pinfo
table.
SELECT * FROM pinfo;
This retrieves all the data from the pinfo
table and displays it.
DROP DATABASE InTro;
This command deletes the InTro
database from the server.