I'm trying to make test data for an application I'm writing, and some of my test data is very repetitive, involving inserting a row and then inserting another row that is identical except for one column. As such, I have very repetitive INSERT statements that make the file longer than I think it needs to be.
INSERT INTO [dbo].[InvoiceItem] (invoice_item_name, amount, invoice_id) VALUES
('TUITION',
(SELECT tuition_amount FROM [dbo].[Grade] WHERE grade_id =
(SELECT grade_id FROM [dbo].[Student] WHERE first_name = 'Murdoch')),
(SELECT invoice_id FROM [dbo].[Invoice] WHERE student_id =
(SELECT student_id FROM [dbo].[Student] WHERE first_name = 'Murdoch' AND invoice_date = '2019-09-05'))),
('TUITION_SERVICE_FEE',
(SELECT tuition_amount FROM [dbo].[Grade] WHERE grade_id =
(SELECT grade_id FROM [dbo].[Student] WHERE first_name = 'Murdoch')) * 0.03,
(SELECT invoice_id FROM [dbo].[Invoice] WHERE student_id =
(SELECT student_id FROM [dbo].[Student] WHERE first_name = 'Murdoch' AND invoice_date = '2019-09-05'))),
('TUITION',
(SELECT tuition_amount FROM [dbo].[Grade] WHERE grade_id =
(SELECT grade_id FROM [dbo].[Student] WHERE first_name = 'Hartwell')),
(SELECT invoice_id FROM [dbo].[Invoice] WHERE student_id =
(SELECT student_id FROM [dbo].[Student] WHERE first_name = 'Hartwell' AND invoice_date = '2019-09-05'))),
('TUITION_SERVICE_FEE',
(SELECT tuition_amount FROM [dbo].[Grade] WHERE grade_id =
(SELECT grade_id FROM [dbo].[Student] WHERE first_name = 'Hartwell')) * 0.03,
(SELECT invoice_id FROM [dbo].[Invoice] WHERE student_id =
(SELECT student_id FROM [dbo].[Student] WHERE first_name = 'Hartwell' AND invoice_date = '2019-09-05'))),
Is there a way to clean this up by any chance?