Skip to content

Repository files navigation

College Database SQL Project

  • A simple MySQL project demonstrating:

Database creation Table creation Inserting records SELECT queries DISTINCT WHERE conditions SQL Constraints (PRIMARY KEY, DEFAULT, CHECK)

📌 Technologies Used

  • MySQL
  • MySQL Workbench

📂 Project Files

1. Conditions Project

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";

2. Constraints Project

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") );

📊 Concepts Covered

Database Creation

  • Table Creation
  • Insert Statements
  • Data Retrieval
  • Filtering Data
  • SQL Constraints

Conditional Queries

▶️ How to Run

  • Open MySQL Workbench
  • Create a new SQL file
  • Copy the SQL code
  • Execute using the ⚡ Execute button

📸 Screenshots

  • Conditions Project
  • Conditional Queries
  • DISTINCT queries
  • Filtering using WHERE

Constraints Project

  • CHECK constraint examples
  • DEFAULT values
  • PRIMARY KEY implementation

👩‍💻 Author

Priya Singh

About

In SQL, constraints are predefined rules applied to table columns to ensure the accuracy, reliability, and integrity of data. They restrict the type of data that can be entered, updated, or deleted; if an operation violates these rules, it is aborted by the database engine.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors