Skip to content
Advertisement

Tag: database

How to simplify nested select in where clause?

I have 4 tables EMPLOYEE, COMPANY, WORKS and MANAGES. The tables are defined as follows- I need to find all the employees who live in the same city as the company for which they work. So far I have done this. It’s working fine. But I want to know is there any simpler way to do this query? Answer You

SQL Query Where Date = Today Minus 7 Days

I have a SQL table of hits to my website called ExternalHits. I track the URL as URLx and the date the page was accessed as Datex. I run this query every week to get the count of total hits from the week before, and every week I have to manually change the “between” dates. Is there some way I

SQL – listing members on enrolled classes

I am trying to figure out why this isn’t working. I am trying to select each member’s names and the classes that each member is enrolled on together with the class trainers name. This is what I have at the minute: Any help or tips would be appreciated as I am still learning SQL. Extra info: enrolment table has columns

Limit SQL Primary Key to certain ranges

I want to make the autoincrementing Primary Key of my table to only be in the ranges 1-12, 101-112, 201-212, etc. This is because I have a series of repeating items that are 12 in a set and then you get another set, having them indexed in this way by the Primary Kay would be most easy, I think. Is

Housing Society management system database structure

I am designing billing structure for housing society yesterday I googled and gone through banking billing structure and designed my database structure but I am not sure whether this would be correct. So I am putting my billing database structure. Please tell me if I am wrong any where or any changes has to be done in my database structure.

Advertisement