- A simple MySQL project demonstrating:
Database creation Table creation Inserting records SELECT queries DISTINCT WHERE conditions SQL Constraints (PRIMARY KEY, DEFAULT, CHECK)
- MySQL
- MySQL Workbench
This project demonstrates SQL conditional queries using WHERE clauses.
- Features Create database and table Insert student records Fetch all records Select specific columns Use DISTINCT Apply conditions using WHERE Example Queries SELECT * FROM student;
SELECT name, rollno FROM student;
SELECT DISTINCT grade FROM student;
SELECT * FROM student WHERE marks > 80 AND city = "DELHI";
This project demonstrates SQL constraints.
Constraints Used PRIMARY KEY DEFAULT CHECK
- Example CREATE TABLE student( rollno INT PRIMARY KEY, name VARCHAR(50), class INT DEFAULT 10, age INT, city VARCHAR(50), CONSTRAINT age_check CHECK(age > 15 AND city = "delhi") );
- Table Creation
- Insert Statements
- Data Retrieval
- Filtering Data
- SQL Constraints
- Open MySQL Workbench
- Create a new SQL file
- Copy the SQL code
- Execute using the ⚡ Execute button
- Conditions Project
- Conditional Queries
- DISTINCT queries
- Filtering using WHERE
- CHECK constraint examples
- DEFAULT values
- PRIMARY KEY implementation
Priya Singh