SQL Database
SQL Database
CREATE TABLE doctors (doctor_id INTEGER PRIMARY KEY, name TEXT, age INTEGER,
address TEXT, phone INTEGER, specialization TEXT);
SELECT name,age FROM patients WHERE age > 50 OR age < 20;
SELECT patient_id,name, CASE WHEN age < 20 😊 THEN "children and teens" WHEN age <
50 THEN "young adults and adults" ELSE "seniors" END "Age Group" FROM patients;
SELECT APPOINTMENT.appointment_id"Appointment Number", doctors.name
"Doctor",patients.name"Patient",patients.age"Patient's Age",
doctors.specialization"Building",APPOINTMENT.appointment_date"Appointment Date" FROM
doctors,patients JOIN APPOINTMENT ON doctors.doctor_id = appointment.doctor_id AND
patients.patient_id = appointment.patient_id;