bashCopy code
sudo systemctl start mysqld
bashCopy code
sudo service mysql start
bashCopy code
sudo /usr/local/mysql/support-files/mysql.server start
bashCopy code
brew services start mysql
sqlCopy code
USE your_database_name;
sqlCopy code
CREATE TABLE students (
studentid varchar(10),
lastname varchar(50),
firstname varchar(50),
address varchar(255),
city varchar(255)
);
sqlCopy code
USE your_database_name;
sqlCopy code
CREATE TABLE students (
studentid varchar(10),
lastname varchar(50),
firstname varchar(50),
address varchar(255),
city varchar(255)
);
sqlCopy code
SHOW DATABASES;
sqlCopy code
CREATE DATABASE collegeEnrollment;
sqlCopy code
CREATE DATABASE CollegeEnrollment CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
sqlCopy code
CREATE TABLE students (
student_id INT AUTO_INCREMENT PRIMARY KEY,
first_name VARCHAR(100) NOT NULL,
last_name VARCHAR(100) NOT NULL,
date_of_birth DATE,
email VARCHAR(255) UNIQUE,
phone_number VARCHAR(15),
address VARCHAR(255),
city VARCHAR(100),
state VARCHAR(50),
postal_code VARCHAR(10),
country VARCHAR(100) DEFAULT 'USA'
);
sqlCopy code
USE your_database_name;
SHOW TABLES;
sqlCopy code
DESCRIBE your_table_name;
sqlCopy code
DESCRIBE students;