Create a Table Example
Create a table called Class that will store college classes for students
DROP DATABASE IF EXISTS `sql_college`;
CREATE DATABASE `sql_college`;
USE `sql_college`;
SET NAMES utf8 ;
SET character_set_client = utf8mb4 ;
DROP TABLE IF EXISTS `class`;
CREATE TABLE `class` (
`classID` varchar(10) NOT NULL,
`className` varchar(150) NOT NULL,
`classHours` tinyint(1) NOT NULL,
`classDepartment` varchar(50) NOT NULL,
`classSectionCode` varchar(10) NOT NULL,
PRIMARY KEY (`classID`)
);
You can add records to the table
INSERT INTO `class` VALUES
('BIS-100','Introduction Databses Fundamentals',4,'Business','July2022'),
('BIS-245','Databases for Business',4,'Business','May2022'),
('CEIS-150','Objects with Python',4,'CS Department','JULY2022'),
('CIS-106','Operating Systems',4,'Computer Science','JULY2022'),
('CIS-115','Intro to C++',4,'Computer Science','MAY2020'),
('CIS-150','Object Oriented Programming using Python',4,'Computer Science','May2022'),
('CIS-216','Advanced C++',4,'Computer Science','MAY2022'),
('CS-110','Introduction to Programming',3,'Computer Science','Feb2022'),
('ENG-101','American Literature',3,'English','Aug2022'),
('ENG-102','World Literature',3,'English','JULY2022');
Â
Â