Skip to content

How to retrieve students data based on teachers ID

According to a simple scenario ER diagram as follows. Based on that, I developed a database mapping as follows. In there, orange color columns shows the primary key of the tables and yellow color …

merging two SQL Scripts

I have been handed the task of merging two scrips so that we can display notes on the results of the first query. I know this might be a long shot but if someone could help that would be great. …

Select table names with specific pattern

I created a query to get all table names with “prefix_” SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME LIKE ‘prefix_%’ AND TABLE_TYPE = ‘BASE TABLE’ But in my database, I have …

SQL: Query column (string) as date

Assume I have a few columns in a database: id, date_added, tag `20134` | `February 07, 2019` | `New` `40323` | `February 09, 2019` | `New` I want to run a query with a filter based on date_added: …

Calculate Duration of Two time

Hi I am new to my sql I am trying to compute the duaration of two time ex: timestart = 21:00 timeend = 03:00 result will be 06:00 my query is like this for compute but it gives me result of 18:00 I …