This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Logical operators are used in SQL to filter records based on multiple conditions in the WHERE clause | |
-- AND → Returns records where both conditions are TRUE | |
-- OR → Returns records where at least one condition is TRUE | |
-- NOT → Negates a condition (returns the opposite result) | |
CREATE DATABASE company_db; | |
USE company_db; | |
CREATE TABLE employees ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE DATABASE bookstore; | |
USE bookstore; | |
CREATE TABLE books ( | |
book_id INT PRIMARY KEY, | |
title VARCHAR(100), | |
author VARCHAR(50), | |
price DECIMAL(10,2), | |
publication_date DATE, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select first_name,email from employees; | |
CREATE DATABASE company; | |
USE company; | |
CREATE TABLE employees ( | |
id INT AUTO_INCREMENT PRIMARY KEY, | |
first_name VARCHAR(50), | |
last_name VARCHAR(50), | |
department VARCHAR(50), |
NewerOlder