Create Tables
1. Create a table called students where each student has an id, name, and age. Ensure that the id uniquely identifies each student. We create a students table with id, name, and age. Since id shoul...

Source: DEV Community
1. Create a table called students where each student has an id, name, and age. Ensure that the id uniquely identifies each student. We create a students table with id, name, and age. Since id should uniquely identify each student and cannot be null, we make it the primary key. create table students (id serial primary key, name varchar(100), age int); 2. Create a table employees where name and email cannot be empty, but phone_number can be optional. We create an employees table with name, email, and phone_number. Since name and email are mandatory, we apply not null, while phone_number is left optional. create table employees (id serial primary key, name varchar(100) not null, email varchar(100) not null, phone_number varchar(20)); 3. Create a table users where both username and email must be unique across all records. We create a users table and ensure that username and email are unique by adding unique constraints so no duplicates are allowed. create table users (id serial primary key