I am using MySQL. There are three tables presented: Patient, Occupies, Room and Privte_Patient. I need to identify the first available room and allocate the room to a newly admitted patient with PIN ‘…
Tag: database
How to insert a query calculation into a column/attribute of an already existing entity?
So I had created a query which was used to calculate sales staff commission this gave me the expected result which I needed , so the next thing i needed to do was to insert these calculated values …
Multithreading for queries in SQL Database
Suppose I have a database, for example, for messenger. My app is collecting messages and stores them in my database. It doesn’t matter what type of database it is (i want to know how it is usually embodied and does my database support it, and are there other databases that do if it doesn’t), but in my case it is
Set ALL Values of PostgreSQL column to X
I have a PostgreSQL database table with same sample data whose schema is shown below. | UserId | XP | Level | ———————– | 123456 | 55 | 12 | | 134156 | 45 | 4 | | 526083 | 39 | 5 …
SQL query to get Net Salse by every month
I’m looking for a query to get monthly net sales I tried this far but I couldn’t get what I want. this is my Order Table +———-+———–+——–+————+—————+————-+—…
How to fill missing dates by ID in a table in sql
I have table A which has Dates and EMPID eg below I also have Table B which has a date range My table A has missing dates and EMPID. How can I merge the two tables to have the following table. Thanks in advance. This is being used in a dataset(SQL) in SSRS. P.S. I’m new to coding in SQL
How to check if a specific data exist in a text file before insert it to SQL database table?
I have a Employee text file employee.txt which has some data in it. For instance: I want to read the file and get the empId from it and pass it to a function to check if that empId already exists in the SQL database table. Here’s my function: How do I get the empId from the file? And how to
How to create a Procedure with specific SQL Select Output in Oracle?
I use an Oracle database and currently I have a problem by creating a Procdure which should create some SQL SELECT Outputs. The procedure was successfully completed but I get no output. It is necessary the work with some temporary variables and another cursor? And it is possible to complement the SQL SELECT Statments with an ORDER BY clause at
How to insert values into table based off values of another table in SQL?
So in SQL, I have a table albums that has (album_id, album_name, year) I also have a table songs that has (song_id, song_name, album_name). I used an alter table statement to add a column to songs called album_id For each song that belongs to an album, I want to add its respective album_id to that row I’m not sure how
Database performance: Split table or keep together
For our project we want to save employees and customer in one or two database tables. The customers have the same columns as the employees (e.g. name, address, language, email,…). The employees on the other side do have additional columns like SocialSecurity Number, bankaccount,… Since the two have many similar columns it might be senseful to merge them into a