Good day, everyone!
I have this new project where I need to turn these scenarios into a DB with ERDs by CREATE DATABASE/CREATE TABLE without typing any actual queries, but all tables are in a one-to-many relationship:
I need to set associated primary keys and foreign keys to each other...
The 1st 2 queries are done, thanks to your amazing support! Is counting the number of admission by year from every province like this:
SELECT Year([admission_date]) AS [Year], province_names.province_name, Count(admissions.patient_id) AS Total
FROM province_names
GROUP BY...
I’m supposed to follow this relationship table. Now, I ponder where to get MonthName(). A close professor of mine just stated that I just need 3 statements:
COUNT
GROUP BY
ORDER BY
Here's the full DB I'm trying to identify. I can't seem to zip it, so I'll send the file here directly.
I have 3 queries to work on:
a. Counting the number of Diseases by Year.
b. Counting the number of Admission by Year and Month.
c. Counting the number of Admission by Year from every Province.
SELECT Year(#11/3/2023#) AS [Year], MonthName(1) AS [Month], Count(*) AS Total
FROM admissions
GROUP BY Month([admission_date])
The output is a blank query. Might I ask why the 'MonthName(Month(admission_date)), Month([admission_date])' part?
Thanks again for responding!
I also had this syntax error with the MonthName() part where it states the message:
"Your query does not include the specified expression 'Month(admission_date)' as part of an aggregate function."
Which is strange because I have an 'admission_date' on my...