Professional Documents
Culture Documents
Databases serve as the foundation for many fields including Data science, Software
development, Decision-making processes. By studying database systems, you gain insights into:
With the use of these abilities, you can store and modify data in a structured manner, extract
important insights from big datasets, run intricate queries, and assist decision-making
process across a variety of industries, including business intelligence, healthcare, finance, and
more.
2. Lab Structure
30 - 80 min: Practice
During this time, the students practice a sample of projects/exercises. In order to
optimize learning and knowledge of the subject, students are expected to engage
with the instructor and ask questions. The instructor will score the students'
performance during this time period based on the effort they put into their practice
activities, as well as their participation and good behavior in the lab session.
3. Grading System
The lab is worth 25% of the course grade.
The lab grade is scaled as follows:
- 55%: Participation (Attendance, in-class behavior and participation, and
computer-based assignments.)
- 25%: Paper-based Assignments.
- 20%: Web Application Project.
4. Absence Regulation
Students who miss more than two lab sessions will be given a WF.
Students who miss lab sessions for a non-valid excuse get a zero in participation
grade for that session.
Students who miss a lab session for a valid excuse should approach their lab
instructor for a possible chance to do the corresponding in-class exercises.
PostgreSQL provides different client applications that you can use to manage PostgreSQL
databases. These client applications enable you to view databases, run SQL queries, and
more. You may access the database from a programming language, through a GUI
application that allows access and administration, or through the command-line interface.
From there, select the operating system you are running. Then follow the instructions
listed on the page to download the database management system. These instructions will
vary depending on the operating system you are using.
Install the downloaded file. During installation, you may be asked to provide an admin
user password. Choose a password and take note of it!!.
Please ignore / untick the prompt to run “Stack Builder”. The latter only handles
installation of additional add-ons that are not necessary for us at the moment. The
PostgreSQL installation should handle the installation of PSQL and PgAdmin.
Your terminal will not magically understand what psqlis when typed as a command. You
need to refer to the definition of psql, in other words, you need to set your Environment
Variables For Your Accounts (use your windows search bar to open it). then click on it.
Select System variable Path and Click “Edit...” button. You should get:
If you face issues, double check whether or not the path is correct by looking at your
installation location manually.
After finishing the installation steps, you may simply click on the elephant icon in your
menu bar → Open Postgres (on Postgres.App) and Double click on one of the Database
that is created by default (for example the postgres database).
To log in to the default database for the first time, type in the following command:
psql -U postgres
Then enter the superuser password that you declared during the installation process. After that, you
should be connected to the PostgreSQL database with the postgres superuser. With that user, you can
see all existing databases by typing: \l .To create a new database, use the following command:
You can also create a new user with the following command:
Then you can create a new database with the new user as the owner:
To connect to the test3 database using the new user instead of the superuser, you need to quit the psql
console using \q. Then reconnect again by typing:
Note: New users can't create new databases or new users. To give them permission, use the following
command:
Finally, it is highly dangerous to drop a database, but you can still do it using one of the following
command lines:
Here's a simple practice exercises to familiarize yourself with PostgreSQL command lines:
Create three databases: "test1", "test2", and "test3" using the following steps: