Page 80 - Computer Software Application TP - Volume 1
P. 80
COMPUTER SOFTWARE APPLICATION - CITS
Step 4: Switch to the New Database:
Use the following command to switch to the newly created database.
USE employeedb;
Step 5: Design Tables:
Create tables with the desired columns and data types. Here’s an example for a simple “users” table:
CREATE TABLE users (
user id INT AUTO INCREMENT PRIMARY KEY,
username VARCHAR(50) NOT NULL,
email VARCHAR(100) UNIQUE NOT NULL,
password VARCHAR(255) NOT NULL,
created at TIMESTAMP DEFAULT CURRENT TIMESTAMP
);
65
CITS : IT & ITES - Computer Software Application - Exercise 21